package com.weifangfirecontrolformal.weifangfirecontrolformal.web.web.business.rulesandregulations;

import cn.hutool.json.JSONObject;
import com.weifangfirecontrolformal.weifangfirecontrolformal.common.base.BaseController;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.Action;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.annotaion.At;
import com.weifangfirecontrolformal.weifangfirecontrolformal.support.model.RespEntity;
import com.weifangfirecontrolformal.weifangfirecontrolformal.web.service.business.rulesandregulations.RulesandregulationsService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.annotation.Resource;

/**
 * 规章制度控制器
 */
@Action
@RequestMapping(value="business/rulesandregulations")
public class RulesandregulationsController extends BaseController {
    @Resource
    public RulesandregulationsService rulesandregulationsService;

    /**
     * 规章制度列表
     * @param
     * page	第几页
     * limit	每页多少条
     * businessId	单位id：如果是机构用户登录需要传,如果是单位用户自己取
     * type	制度类型:对应字典表数据
     * createyear	创建年份
     * @return
     */
    @At(value = "rulesandregulationsListPage", method = RequestMethod.GET, param = { "page","limit"})
    public RespEntity rulesandregulationsListPage(@RequestBody(required = false) JSONObject jsonParam) {
        return rulesandregulationsService.rulesandregulationsListPage(jsonParam);
    }

    /**
     * 规章制度详情
     * @param  id	规章制度的id
     * @return
     */
    @At(value = "rulesandregulationsDetail", method = RequestMethod.GET, param = { "id"})
    public RespEntity rulesandregulationsDetail(@RequestBody(required = false) JSONObject jsonParam) {
        return rulesandregulationsService.rulesandregulationsDetail(jsonParam);
    }

    /**
     * 规章制度新增
     * @param
     * remarks	备注
     * name	名称
     * type	制度类型:对应字典表数据
     * fileName	附件名称
     * filePath	附件路径
     * @return
     */
    @At(value = "rulesandregulationsAdd", method = RequestMethod.POST)
    public RespEntity rulesandregulationsAdd(@RequestBody(required = false) JSONObject jsonParam) {
        return rulesandregulationsService.rulesandregulationsAdd(jsonParam);
    }

    /**
     * 规章制度修改
     * @param
     * remarks	备注
     * name	名称
     * type	制度类型:对应字典表数据
     * fileName	附件名称
     * id	规章制度id
     * filePath	附件路径
     * @return
     */
    @At(value = "rulesandregulationsUpdate", method = RequestMethod.POST, param = { "id" })
    public RespEntity rulesandregulationsUpdate(@RequestBody(required = false) JSONObject jsonParam) {
        return rulesandregulationsService.rulesandregulationsUpdate(jsonParam);
    }

    /**
     * 规章制度删除
     * @param   id	规章制度的id
     * @return
     */
    @At(value = "rulesandregulationsDelete", method = RequestMethod.POST, param = { "id" })
    public RespEntity rulesandregulationsDelete(@RequestBody(required = false) JSONObject jsonParam) {
        return rulesandregulationsService.rulesandregulationsDelete(jsonParam);
    }






   
}